In performing an exclusive control over a plurality of databases, such a situation, namely, a deadlock, may occur that, for example, one transaction locks a database A while waiting for a database B to be unlocked, and another transaction locks the database B while waiting for the database A to be unlocked, and the processing never progresses forever. When a deadlock occurs, such a processing is generally taken that one transaction is aborted and another transaction is completed in order to resolve the deadlock, for example.
Conventionally, in order to reduce occurrence of such a deadlock, application developers have created applications in such a way that an update order of the plurality of databases is preliminarily determined and an update of the databases is performed in accordance with the order.
Referring to FIG. 1 to provide the more detailed description, when there are two databases, a table T1 and a table T2, application developers preliminarily determine that the tables T1 and T2 are updated in that order, and create all applications A1 and A2 which access to the databases to update the databases in that order. Thereby, that makes it possible to reduce the occurrence of the deadlock.
In recent years, the application development has been becoming more likely to create applications using existing components and resources. This is considered to be attributable that a component design has been pervading as an application developing method and that a service oriented architecture (SOA) has been suggested which achieves operations of customers with a flexible combination of services/components.
In such a component-based application development, an increase in the frequency of deadlocks is a problem in terms of data access implementation. The reason why the frequency of the deadlocks increases is that a flexible combination of components causes a change in an execution sequence, resulting in an inability to maintain consistency of an update order of databases. In the example shown in FIG. 1, the reshuffle of the execution sequence of components C1 and C2 in the application A1 causes inconsistency of the update order for the database as shown in FIG. 2, resulting in the occurrence of a deadlock.
The conventional fundamental strategy for avoiding the deadlock is, as described above, to create applications so that the update orders are standardized among the applications sharing the databases. However, it is difficult to secure this standardization of the order in SOA-based applications or component-based applications, which flexibly reshuffle the execution sequence in accordance with a change in operations.
In addition, in the development per component, the update order within one component can be standardized, but it is not avoidable that the update order becomes a nesting structure as a whole if one processing is realized with a plurality of components, as shown in FIG. 3.
While the update order of the databases depends on a combination order of the components performing database accesses, it is difficult that a person who takes care of the combination of the components also comprehends contents of the data access within the components. Moreover, depending on the contents of the components, it may not be possible to standardize the update order regardless of the order of invoking the components.